package com.sxpcwlkj.system.runner;

import cn.hutool.core.lang.Console;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.sxpcwlkj.common.constant.CacheConstants;
import com.sxpcwlkj.common.utils.RedisUtil;
import com.sxpcwlkj.system.entity.SysDict;
import com.sxpcwlkj.system.entity.SysDictData;
import com.sxpcwlkj.system.mapper.SysDictDataMapper;
import com.sxpcwlkj.system.mapper.SysDictMapper;
import com.sxpcwlkj.system.service.SysDictService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author shanpengnian
 * @ClassName MyCommandLineRunner
 * @description: 项目初始化
 * @date 2024年03月29日
 * @version: 1.0
 */

@Slf4j
@Component
@RequiredArgsConstructor
@Order(1) // 可以通过@Order注解指定执行顺序，数字越小越先执行
public class MyCommandLineRunner implements CommandLineRunner {


    private final SysDictService sysDictService;

    @Override
    public void run(String... args) throws Exception {
        // 在这里执行启动时需要执行的操作

        log.info("=== "+sysDictService.initSysDict(null)+"个:字典已初始化 ===");

    }
}